import 'package:flutter/material.dart';
import 'package:love_app/common/su.dart';
import 'package:love_app/routes/application.dart';
import 'package:love_app/test/bug_test.dart';

// 用于底部导航栏测试
class BottomTest extends StatefulWidget {
  @override
  _BottomTestState createState() => _BottomTestState();
}

class _BottomTestState extends State<BottomTest> {
  @override
  Widget build(BuildContext context) {
    Su.suPrints("BottomTest测试页面");
    return Scaffold(
      appBar: AppBar(
        title: Text("BottomTest测试页面"),
      ),
      body: _body(),
    );
  }

  Widget _body(){
    return Center(
      child: RaisedButton(
        onPressed: (){
          // Application.router
          //         .navigateTo(context, "/bugTest");
          Navigator.of(context).push(MaterialPageRoute(
            builder: (context){
              return BugTest();
            }
          ));
        },
        child: Text("nextPage"),
      ),
    );
  }
}


class BottomPage1 extends StatefulWidget {
  @override
  _BottomPage1State createState() => _BottomPage1State();
}

class _BottomPage1State extends State<BottomPage1> {
  @override
  Widget build(BuildContext context) {
    Su.suPrints("BottomTest测试页面1");
    return Scaffold(
      appBar: AppBar(
        title: Text("BottomTest测试页面1"),
      ),
      body: _body(),
    );
  }

  Widget _body(){
    return Center(
      child: RaisedButton(
        onPressed: (){
          Application.router
                  .navigateTo(context, "/bugTest");
        },
        child: Text("nextPage1"),
      ),
    );
  }
}


class BottomPage2 extends StatefulWidget {
  @override
  _BottomPage2State createState() => _BottomPage2State();
}

class _BottomPage2State extends State<BottomPage2> {
  @override
  Widget build(BuildContext context) {
    Su.suPrints("BottomTest测试页面2");
    return Scaffold(
      appBar: AppBar(
        title: Text("BottomTest测试页面2"),
      ),
      body: _body(),
    );
  }

  Widget _body(){
    return Center(
      child: RaisedButton(
        onPressed: (){
          Application.router
                  .navigateTo(context, "/bugTest");
        },
        child: Text("nextPage2"),
      ),
    );
  }
}


class AdNextPage extends StatefulWidget {
  @override
  _AdNextPageState createState() => _AdNextPageState();
}

class _AdNextPageState extends State<AdNextPage> {
  @override
  Widget build(BuildContext context) {
    Su.suPrints("AdPage进来的页面");
    return Scaffold(
      appBar: AppBar(
        title: Text("AdPage进来的页面"),
      ),
      body: _body(),
    );
  }

  Widget _body(){
    return Center(
      child: RaisedButton(
        onPressed: (){
          Application.router
                  .navigateTo(context, "/bugTest");
        },
        child: Text("nextPage2"),
      ),
    );
  }
}